package com.sjd.mall.mapper;


import com.sjd.mall.domain.SjdGoodsCommentDO;
import com.sjd.mall.domain.dto.goods.SjdGoodsCommentQueryResponseDTO;
import com.sjd.mall.domain.dto.goods.SjdWebSiteGoodsCommentQueryResponseDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author s
 */
public interface SjdGoodsCommentMapper {
    /**
     * delete
     *
     * @param id id
     * @return return
     */
    int deleteByPrimaryKey(Long id);

    /**
     * insert
     *
     * @param record record
     * @return return
     */
    int insert(SjdGoodsCommentDO record);

    /**
     * insertSelective
     *
     * @param record record
     * @return return
     */
    int insertSelective(SjdGoodsCommentDO record);

    /**
     * selectByPrimaryKey
     *
     * @param id id
     * @return return
     */
    SjdGoodsCommentDO selectByPrimaryKey(Long id);

    /**
     * updateByPrimaryKeySelective
     *
     * @param record record
     * @return return
     */
    int updateByPrimaryKeySelective(SjdGoodsCommentDO record);

    /**
     * updateByPrimaryKeySelective
     *
     * @param record record
     * @return return
     */
    int updateByPrimaryKey(SjdGoodsCommentDO record);

    /**
     * 逻辑删除评论
     *
     * @param goodsCommentId goodsCommentId
     * @return return
     */
    int logicDeleteComment(Long goodsCommentId);

    /**
     * 管理平台查找评论
     *
     * @param memberName memberName
     * @param goodsName  goodsName
     * @param endTime endTime
     * @param startTime startTime
     * @param goodsCommentId goodsCommentId
     * @return return
     */
    List<SjdWebSiteGoodsCommentQueryResponseDTO> getCommentWebSite(@Param("goodsCommentId") Long goodsCommentId, @Param("memberName") String memberName, @Param("goodsName") String goodsName,
                                                           @Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 管理平台根据商品id获取评论
     * @param goodsId goodsId
     * @return return
     */
    List<SjdWebSiteGoodsCommentQueryResponseDTO> getCommentWebSiteByGoodsId(@Param("goodsId") Long goodsId);

    /**
     * 管理平台根据评论id获取评论
     * @param commentId commentId
     * @return return
     */
    SjdWebSiteGoodsCommentQueryResponseDTO getCommentWebSiteByCommentId(@Param("goodsId") Long commentId);


    /**
     * 查询主评论
     * @param goodsId goodsId
     * @return return
     */
    List<SjdGoodsCommentQueryResponseDTO> getRootCommentApp(@Param("goodsId") Long goodsId);

    /**
     * 查询追评
     * @param parentId parentId
     * @return return
     */
    List<SjdGoodsCommentQueryResponseDTO> getChildCommentApp(@Param("parentId") Long parentId);
}